
<script lang="ts" setup>
	import { wxchatMiniUpdate } from "./lib/ts/util"
	import { useStore } from "./store/index"
	import { onLaunch,onShow,onUnload } from  "@dcloudio/uni-app"
	
	
	onLaunch(()=>{
		console.log('App Launch')	
		const store = useStore()
		store.getUserinfo()
		store.getConfig()
		store.getLocation()
		// #ifdef MP-WEIXIN
			wxchatMiniUpdate()
		// #endif
	})
	
	onShow((e)=>{
		console.log('App Show')
		if(e.query.scene){
			let scene = decodeURIComponent(e.query.scene)
			let arr = scene.split('&')
			let params = {}
			arr.forEach(item=>{
				params[item.split('=')[0]] = item.split('=')[1]
			})
			if(params.pid) uni.setStorageSync('pid',params.pid)
		}
		
		if(e.query.sf_pid){
			uni.setStorageSync('sf_pid',e.query.sf_pid)
		}
		if(e.query.xy_pid){
			uni.setStorageSync('xy_pid',e.query.xy_pid)
		}
		
		
		
	})
	
	onUnload(()=>{
		uni.removeStorageSync('pid')
	})
</script>


<style lang="scss">	
	@import  "./uni_modules/vk-uview-ui/index.scss";
	@import  "./lib/css/util.css";
	@import url("uni_modules/vk-uview-ui/iconfont.css");
	@import url("lib/iconfont/defaultStore/iconfont.css");
	/*每个页面公共css */
	
	page{
		background-color: #f5f6f7;
	}
	
	.mainC{
		color: $main-color;
	}
	.mainBC{
		background-color:$main-color;
	}
	.Allbottom{
		position: fixed;
		z-index: 11;
		bottom: 0;
		left: 0;
		background-color: #fff;
		box-shadow: inset 0rpx 2rpx 0rpx 0rpx #EDEDED;
		width: 100%;
		height: 120rpx;
		.btn{
			background-color: $main-color;
			width: 690rpx;
			height: 80rpx;
			border-radius: 40rpx;
		}
	}
	
</style>
